import { Application } from "egg";
import helper from "./helper";

export default (app: Application) => {
  const { controller, router } = app;

  helper.registRestfulRoute(controller.v1.platform, router, "/api/v1", "platforms");
  helper.registRestfulRoute(controller.v1.application, router, "/api/v1", "applications");
  helper.registRestfulRoute(controller.v1.device, router, "/api/v1", "devices");

  router.get("/security/login", controller.security.login);
  router.post("/security/login", controller.security.login);
};
